﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Caching.Memory;

namespace WebApp.Services
{
    public class MemoryCacheService : ICacheService
    {
        protected IMemoryCache _cache;

        public MemoryCacheService(IMemoryCache cache)
        {
               _cache = cache;
        }


        public bool Add(string key, object value)
        {
            _cache.Set(key, value);


            return true;
        }

        public object Get(string key)
        {
            return _cache.Get(key);
        }
    }
}
